// 频道相关的接口
import request from '@/utils/request'

// 获取所有频道列表
export const getAllChannel = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels',
  })
}

// 获取用户已选的频道
export const getUserChannel = () => {
  return request({
    method: 'GET',
    url: '/v1_0/user/channels',
  })
}

// 设置频道列表
export const setChannel = (channels) => {
  return request({
    method: 'PUT',
    url: '/v1_0/user/channels',
    data: {
      channels,
    },
  })
}
